import React from "react";
import styles from "./index.module.less";
import defaultHead from "@images/sex1.webp";
import { connect } from "react-redux";
import { isShowAddFriendBounced } from "@redux/actions02";

const Item = (props) => {
    const { item, isShowAddFriendBounced, transInfo } = props;

    return (
        <li className={styles.item}>
            <div className={styles.avatar}>
                <img
                    src={
                        item?.avatarUrl
                            ? require(`@images/head/${item.avatarUrl}`)
                            : defaultHead
                    }
                    alt=""
                />
            </div>
            <div className={styles.user_info}>
                <p className={styles.user_name}>{item?.userName || ""}</p>
                <p className={styles.user_add_intro}>
                    {item?.applyWords || ""}
                </p>
            </div>
            <div
                className={styles.accept_btn}
                onClick={() => {
                    isShowAddFriendBounced(true);
                    transInfo(item?.userName);
                }}
            >
                接受
            </div>
            {/* <p className={styles.accepted}>已接受</p> */}
        </li>
    );
};

export default connect((state) => state, { isShowAddFriendBounced })(Item);
